import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {HttpModule} from '@angular/http';
import {InfiniteScrollModule} from 'angular2-infinite-scroll';

import {AppComponent} from './app.component';
import {HeaderComponent} from './views/header/header.component';
import {FooterComponent} from './views/footer/footer.component';
import {HomeComponent} from './views/home/home.component';
import {RouterModule, Routes} from '@angular/router';
import {ProjectComponent} from './views/project/project.component';
import {PageNotFoundComponent} from './views/page-not-found/page-not-found.component';
import {NavigationComponent} from './views/navigation/navigation.component';
import {SliderComponent} from './views/slider/slider.component';
import {HttpService} from './service/http.service';
import {SortComponent} from './views/sort/sort.component';
import {MoneyPipe} from './utils/meony.pipe';

const routes: Routes = [
  {path: '', redirectTo: '/home', pathMatch: 'full'},
  {path: 'home', component: HomeComponent},
  {path: 'project/:id', component: ProjectComponent},
  {path: 'sort', component: SortComponent},
  {path: '**', component: PageNotFoundComponent}
];

@NgModule({
  declarations: [
    AppComponent,
    HeaderComponent,
    FooterComponent,
    HomeComponent,
    NavigationComponent,
    ProjectComponent,
    PageNotFoundComponent,
    SliderComponent,
    SortComponent,
    MoneyPipe
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    RouterModule.forRoot(routes),
    InfiniteScrollModule
  ],
  providers: [HttpService],
  bootstrap: [AppComponent]
})
export class AppModule {
}
